<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%> 
 
<div style="margin:20px 0;"></div>
<div class="easyui-panel" >
	<div style="padding:10px 60px 20px 60px">
    <form id="superBankForm"  name="superBankForm" method="post" >
    	<input type="hidden" name="super_bank_uuid" value="${appInfSuperbankEntity.super_bank_uuid}"/>
    	<table cellpadding="5" style="width:100%">
    		<tr>
    			<td>总行行号:</td>
    			<td><input class="easyui-textbox" type="text" name="super_bank_no" data-options="required:true,validType:'checksuperbankno'" value="${appInfSuperbankEntity.super_bank_no }"></input></td>    	     			
    		</tr>
    		<tr>
    			<td>银行名称:</td>
    			<td><input class="easyui-textbox" type="text"  name="bank_nm" data-options="required:true,validType:['length[0,120]']" value="${appInfSuperbankEntity.bank_nm}"></input></td>    		     			
    		</tr>
    		<tr>
    			<td>银行地址:</td>
    			<td><input class="easyui-textbox" type="text"  name="bank_addr" value="${appInfSuperbankEntity.bank_addr}"></input></td>    		     			
    		</tr> 
    		<tr>
    			<td>是否使用:</td>
    			<td><code:codeSelect id="is_make" name="is_make" code_type="bank_ismake" showSelect="true" selectId="${appInfSuperbankEntity.is_make}"></code:codeSelect></td>    		     			
    		</tr>   		    		 
    	</table>
    
	    <div style="text-align:center;padding:5px">
	    	<!-- <a href="javascript:void(0)" class="easyui-linkbutton btn" iconCls="icon-save" id="saveBtn" onclick="save()">保存</a>
	    	<a href="javascript:void(0)" class="easyui-linkbutton btn" iconCls="icon-back" onclick="back()">返回</a> -->
	    	
	    	<jiepos:buttonDetailTag menuCode="${menuCode}" formId="superBankForm"></jiepos:buttonDetailTag>
	    </div>
    </form>
    </div>
</div>
<script>
	function save(urls){
		$.extend($.fn.textbox.defaults.rules, {           
			checksuperbankno: {     
	            validator: function(value){               
	                 var reg = new RegExp("^[a-zA-Z0-9]{0,12}$"); 
	                 return reg.test(value);  
	            },     
	            message: '总行行号需为0-12位数字或字母'     
	        }
		});
		if($("#superBankForm").form("validate")){				
			var options ={   
			         url:'<c:url value="/superbank/checkSuperbank.do"/>',   
			         type:'post',                    
			         success:function(data){
			            	var result=data;
							if("success"==result){					  
								//表单提交的方法、比如ajax提交
						    	$("#superBankForm").attr("action",urls);
						    	document.getElementById("superBankForm").submit();  						  
							}else{
								$.jpmessage.info('总行行号不能重复!');
							}
			          }   
			       };
			$("#superBankForm").ajaxSubmit(options); 
		}
	}
 
	
</script>